class Cols {
  constructor(cols = 26) {
    if (typeof cols !== 'number') {
      throw new Error('cols must be a number')
    } else {
      if (cols > 26 || cols < 0) {
        throw new Error('cols must greater than 0 or less than 26')
      }
    }
    this.cols = cols
    this.ths = this._generateCols()
  }
  _generateCols() {
    const ths = Array(this.cols).fill(null).map((v, idx) => {
      const th = document.createElement('th')
      th.innerText = String.fromCharCode(65 + idx)
      return th
    })
    const firstTh = document.createElement('th')
    ths.unshift(firstTh)
    return ths
  }
}
